package utils;

import android.content.Intent;
import android.content.SharedPreferences;

import com.example.financialsystem.application.MyApplication;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

import static android.content.Context.MODE_PRIVATE;

public class SharedPreferencesUtil {

    private String fileName;
    private SharedPreferences.Editor editor;

    public SharedPreferencesUtil(String fileName) {
        this.fileName = fileName;
        editor = MyApplication.getContext().getSharedPreferences(fileName,MODE_PRIVATE).edit();
    }

    public void put(String key,String value){
        editor.putString(key,value);
    }

    public void put(String key, int value){
        editor.putInt(key,value);
    }

    public void put(String key, float value){
        editor.putFloat(key,value);
    }

    public void put(String key, boolean value){
        editor.putBoolean(key,value);
    }

    public void apply(){
        editor.apply();
    }

}
